﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GN.Pay.Client.Request.Trade
{
    /// <summary>
    /// 支付申请请求
    /// </summary>
    public class PayApplyRequest : OrderRequest
    {
        /// <summary>
        /// 订单时间
        /// </summary>
        public DateTime OrderTime { get; set; }

        /// <summary>
        /// 订单金额
        /// </summary>
        [Range(0.01, (double)decimal.MaxValue, ErrorMessage = "订单金额不能低于0.01元")]
        public decimal OrderMoney { get; set; }

        /// <summary>
        /// 会员编号
        /// </summary>
        [StringLength(maximumLength: 64, ErrorMessage = "会员编号长度最多为64")]
        public string MemberNo { get; set; }

        /// <summary>
        /// 商品标题
        /// </summary>
        [Required(ErrorMessage = "商品标题不能为空")]
        [MaxLength(255, ErrorMessage = "商品标题不能超过255个字符")]
        public string Subject { get; set; }

        /// <summary>
        /// 商品详情
        /// </summary>
        [MaxLength(1000, ErrorMessage = "商品详情不能超过1000个字符")]
        public string Body { get; set; }

        /// <summary>
        /// 后台通知地址(Post)
        /// </summary>
        [MaxLength(255)]
        public string NotifyUrl { get; set; }

        /// <summary>
        /// 返回地址(Get)
        /// </summary>
        [MaxLength(255)]
        public string ReturnUrl { get; set; }

        /// <summary>
        /// 订单备注
        /// </summary>
        public string Remark { get; set; }

        /// <summary>
        /// 获取或设置用户标识(如微信 openId等)
        /// </summary>    
        [MaxLength(255, ErrorMessage = "用户标识不能超过 255 位的长度 ")]
        public string UserToken { get; set; }

        /// <summary>
        /// 过期分钟
        /// </summary>
        [Range(0, int.MaxValue, ErrorMessage = "过期分钟必须大于或等于0")]
        public int ExpireMinute { get; set; }        

        /// <summary>
        /// 扩展参数
        /// </summary>
        public string ExtraParam { get; set; }
    }
}
